package com.j3a.journal.model;

// Generated 21 oct. 2014 14:53:50 by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Numero generated by hbm2java
 */
@Entity
@Table( name = "numero"
        , catalog = "journal" )
public class Numero implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private Integer           numeroId;
    private Date              numeroDate;
    private Set<Article>      articles         = new HashSet<Article>( 0 );

    public Numero() {
    }

    public Numero( Date numeroDate, Set<Article> articles ) {
        this.numeroDate = numeroDate;
        this.articles = articles;
    }

    @Id
    @GeneratedValue( strategy = IDENTITY )
    @Column( name = "NUMERO_ID", unique = true, nullable = false )
    public Integer getNumeroId() {
        return this.numeroId;
    }

    public void setNumeroId( Integer numeroId ) {
        this.numeroId = numeroId;
    }

    @Temporal( TemporalType.DATE )
    @Column( name = "NUMERO_DATE", length = 10 )
    public Date getNumeroDate() {
        return this.numeroDate;
    }

    public void setNumeroDate( Date numeroDate ) {
        this.numeroDate = numeroDate;
    }

    @ManyToMany( fetch = FetchType.LAZY, mappedBy = "numeros" )
    public Set<Article> getArticles() {
        return this.articles;
    }

    public void setArticles( Set<Article> articles ) {
        this.articles = articles;
    }

}
